//
//  SmallDecisionsSjsCell.m
//  SmallDecisions
//
//  Created by 李付雄 on 2025/7/26.
//

#import "SmallDecisionsSjsCell.h"

@interface SmallDecisionsSjsCell()

@property (nonatomic, strong) UIView *contianerBgView;

@end

@implementation SmallDecisionsSjsCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style
              reuseIdentifier:(NSString *)reuseIdentifier {

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {

        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = [UIColor clearColor];

        [self createSmallDecisionsSjsCellSubviews];
    }
    return self;
}

- (void)createSmallDecisionsSjsCellSubviews {
    [self contianerBgView];
    [self contentLabel];
}

- (UIView *)contianerBgView {
    if(!_contianerBgView) {
        _contianerBgView = [[UIView alloc] init];
        _contianerBgView.backgroundColor = SmallDecisionsSecondBgColor;
        _contianerBgView.layer.cornerRadius = 10;
        _contianerBgView.layer.masksToBounds = YES;
        [self.contentView addSubview:_contianerBgView];
        [_contianerBgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(20);
            make.right.mas_equalTo(-20);
            make.top.mas_equalTo(10);
            make.bottom.mas_equalTo(-10);
        }];
    }

    return _contianerBgView;
}


- (UILabel *)contentLabel {
    if(!_contentLabel) {
        _contentLabel = [[UILabel alloc] init];
        _contentLabel.textColor = SmallDecisionsThemeFontColor;
        _contentLabel.font = SmallDecisionsSetFontSize(16);
        _contentLabel.textAlignment = 1;
        [self.contianerBgView addSubview:_contentLabel];
        [_contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.top.mas_offset(0);
        }];
    }

    return _contentLabel;
}

@end
